home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
399_01
/
mined.doc
< prev
next >
Wrap
Text File
|
1993-08-03
|
23KB
|
431 lines
+=====================================================================+
| Documentation file of the Mined editor. |
+=====================================================================+
Author: Michiel Huisjes.
Modified by Achim Mⁿller to run on a Unix machine with VT100-like
terminals attached and to recognize function key character sequences.
Modifications and corrections made by Thomas Wolff:
Basic capabilities:
Runs with arbitrary terminals on UNIX (using termcap).
Responds correctly to changes of window size, including
redisplay of status line; keeps position in text.
Accepts and displays an 8 bit character set.
User interface:
Two letter ESCAPE commands are used for less frequent functions.
The concept of a HOP key prefix was introduced which fortifies
any positioning function that follows. This provides more
command flexibility without too much need of key remembering.
Command key layout changed to resemble WordMaster/WordStar.
Improved behaviour:
Stripping off lines too long for the screen implemented
also on status line output. If status line input overflows
the screen and wraps/scrolls, the screen is redisplayed.
Search displays a "wrap around end of file" message for
better orientation.
In case of system errors, the appropriate error message
is fetched and displayed instead of printing
numerical hieroglyphs or indistinguished
commonplace messages (as many UNIX commands do).
Additional features and commands:
A HELP command.
A SUSPEND command with automatic file saving.
A repeat search command.
A replace command with confirmation dialogue.
A change working directory command.
A change file name reference command.
Reading from standard input and writing to standard output.
Starting up at a given line number.
Appending versions of the buffer cut/copy/write commands.
Process-independent version of the paste command, thus enabling
inter-window paste operations.
A view only version of the edit command (not yet very well developed).
Commands to print buffer / to perform command with buffer as input.
Positioning to a percentage within the text.
Accepts control char sequence for absolute positioning (by mouse)
Multi-file edit
External interrupt handling with attempts to save the text
Configurable indicators for line shift left/right, line end, tab.
Improved text security:
Doesn't quit if a file save fails or even if the question for
a filename isn't answered. So you have a chance
to try another filename or something.
Asks whether to overwrite file whenever a file is to be
written to which was not previously read in.
Removed abort_mined since no one wants to kill an editor
unconditionally without attempt to save the text.
Corrections:
Some screen positioning errors and inconsistencies
have been eliminated, for example:
The EF function now really positions to the end of the text, not
to the beginning of the last line,
The HIGH and LOW functions now stay in the current screen column,
as UP and DN do now more consistently.
Input routine detects overflow of input buffer.
Doesn't crash if a file loaded or inserted contains NULL chars.
Scratch file counting and deleting was corrected.
The Readonly flag and status message is now based on the really
effective circumstances (could show wrong state before if
real and effective user id were different).
Several minor modifications, e.g.: XBREAK (the screen column limit)
was increased by 1, since two columns were left blank on
the right screen border.
Missing modification:
The rightmost screen column is currently unused because
linefeed is used as a line positioner. If absolute
positioning would be added for each text line output,
the screen column limit XBREAK could again be increased by 1.
Many further improvements, including special MSDOS adaptations, not
further described here. See the help file for information about
mined's features.
1. General remarks.
Mined is a screen editor designed for the minix operating system.
It is meant to be used on files not larger than 50K and to be fast.
When mined starts up, it reads the file into its memory to minimize
disk access. The only time that disk access is needed is when certain
save, write or copy commands are given.
Mined has the style of Emacs or Jove, that means that there are no modes.
Each character has its own entry in an 256 pointer to function array,
which is called when that character is typed. Only ASCII characters are
connected with a function that inserts that character at the current
location in the file. Two exceptions are <linefeed> and <tab> which are
inserted as well. Note that the mapping between commands and functions
called is implicit in the table. Changing the mapping just implies
changing the pointers in this table.
The display consists of SCREENMAX + 1 lines and XMAX + 1 characters. When
a line is larger (or gets larger during editing) than XBREAK characters,
the line is either shifted SHIFT_SIZE characters to the left (which means
that the first SHIFT_SIZE characters are not printed) or the end of the
line is marked with the SHIFT_MARK character and the rest of the line is
not printed. A line can never exceed MAX_CHARS characters. Mined will
always try to keep the cursor on the same line and same (relative)
x-coordinate if nothing changed. So if you scroll one line up, the cursor
stays on the same line, or when you move one line down, the cursor will
move to the same place on the line as it was on the previous.
Every character on the line is available for editing including the
linefeed at the the of the line. When the linefeed is deleted, the current
line and the next line are joined. The last character of the file (which
is always a linefeed) can never be deleted.
The bottomline (as indicated by YMAX + 1) is used as a status line during
editing. This line is usually blank or contains information mined needs
during editing. This information (or rather questions) is displayed in
reverse video.
The terminal modes are changed completely. All signals like start/stop,
interrupt etc. are unset. The only signal that remains is the quit signal.
The quit signal (^\) is the general abort signal for mined. Typing a ^\
during searching or when mined is asking for filenames, etc. will abort
the function and mined will return to the main loop.
Sending a quit signal during the main loop will abort the session
(after confirmation) and the file is not (!) saved. *removed*
The session will also be aborted when an unrecoverable error occurs, e.g.
when there is no more memory available. If the file has been modified,
mined will ask if the file has to be saved or not.
If there is no more space left on the disk, mined will just give an error
message and continue.
The number of system calls are minimized. This is done to keep the editor
as fast as possible. I/O is done in SCREEN_SIZE reads/writes. Accumulated
output is also flushed at the end of each character typed.
2. Regular expressions
Mined has a built in regular expression matcher, which is used for
searching and replace routines. A regular expression consists of a
sequence of:
1. A normal character matching that character.
2. A . matching any character.
3. A ^ matching the begin of a line.
4. A $ (as last character of the pattern) mathing the end of a line.
5. A \<character> matching <character>.
6. A number of characters enclosed in [] pairs matching any of these
characters. A list of characters can be indicated by a '-'. So
[a-z] matches any letter of the alphabet. If the first character
after the '[' is a '^' then the set is negated (matching none of
the characters).
A ']', '^' or '-' can be escaped by putting a '\' in front of it.
Of course this means that a \ must be represented by \\.
7. If one of the expressions as described in 1-6 is followed by a
'*' than that expressions matches a sequence of